package h0717;

import java.util.Scanner;

/**
 * @author 不知名帅哥
 * @version 1.0
 * @description 检查是否存在满足条件的数字组合 A=B+2C
 * @date 2024/7/17 14:13
 */
public class NumberCombination {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        getResult(arr);
    }

    private static void getResult(int[] arr) {
        int n = arr.length;
        boolean found=true;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j) continue; //每个数字只能用一次
                for (int k = 0; k < n; k++) {
                    if (k == i || k == j) continue;
                    if (isCombination(arr[i], arr[j], arr[k])) {
                        found=false;
                        System.out.println(arr[i] + " " + arr[j] + " " + arr[k]);
                    }
                }
            }
        }
        if (found){
            System.out.println(0);
        }
    }

    private static boolean isCombination(int i, int j, int k) {
        return i == j + 2 * k;
    }
}
